<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            width: 100%;
            height: 3000px;
        }
        nav{
           width: 100%;
           height: 50px;
           background-color: red; 
        }
        .box01{
            width: 500px;
            height: 400px;
            background-color: yellow;
            position: fixed;
            left: 50%;
            top: 50%;
            margin-left: -250px;
            margin-top: -200px;
            z-index: 3;
        }
        .box01>div{
            width: 100%;
            height: 30px;
            background-color: green;
        }
        .box02{
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,.5);
            position: fixed;
            top: 0;
            z-index: 2;
        }
    </style>
</head>
<body>
    <nav>导航</nav>
    <div class="box01">
        <div>标题</div>
    </div>
    <div class="box02"></div>
</body>
</html>